﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once

#include "IFamilyConnector2d.h"
#include "FamilyConnectorEnums.h"

namespace gfam
{
    /// \brief 市政二维连接点接口类
    class GM_FAMILY_SERVICE_EXPORT IFamilyMunicipalConnector2d : public gfam::IFamilyConnector2d
    {
        DEFINE_CAST_DERIVED(gfam::IFamilyMunicipalConnector2d, gfam::IFamilyConnector2d)

    public:
        /// \brief 创建二维连接点
        ///
        /// \param pDoc 文档指针，输入为空时，创建失败，返回nullptr
        /// \param curveId 二维线Id，Id无效时，创建失败，返回nullptr
        /// \param normalizedParameterOnCurve 二维连接点在二维线上的位置，用归一化参数表示，范围是[0,1],小于0时设置为0，大于1时设置为1
        /// \param direction 方向
        /// \return 创建成功返回市政二维连接点指针，创建失败返回nullptr
        static IFamilyMunicipalConnector2d* Create(gcmp::IDocument *pDoc,
            const gcmp::ElementId &curveId, double normalizedParameterOnCurve,
            const gcmp::Vector3d &direction);

        /// \brief 获取Implementation Uid
        ///
        /// \return UniIdentity 返回ImplementationUid
        static gcmp::UniIdentity GetImplementationUid();

        /// \brief 获取连接点的方向
        /// 
        /// \return 连接点的方向
        virtual gcmp::Vector3d GetDirection() const = 0;

        /// \brief 设置连接点的方向
        /// 
        /// \param connectorType 连接点的方向
        virtual void SetDirection(const gcmp::Vector3d &direction) = 0;

        /// \brief 获取连接点的市政连接件连接方式类型
        /// 
        /// \return 市政连接件连接方式类型
        virtual ConnectionType GetConnectionType() const = 0;

        /// \brief 设置连接点的市政连接件连接方式类型
        /// 
        /// \param connectionType 市政连接件连接方式类型
        virtual void SetConnectionType(ConnectionType connectionType) = 0;
    };
}
